#include <iostream>
#include <assert.h>
using namespace std;

template<class T>
class SeqList
{
public:
	SeqList(int capacity = 4) :
		_size(0),
		_capacity(capacity)
	{
		_a = new T[capacity];
	}

	~SeqList()
	{
		delete[] _a;
	}

	void push(T x)
	{
		_a[_size] = x;
	}
	void pop();
	void del();

private:
	T* _a;
	int _size;
	int _capacity;

};

template<typename T>
void SeqList<T>::pop()
{
	assert(_size >= 1);
	_size--;
}

template<typename T>
void SeqList<T>::del()
{
	delete[] _a;
	size = _capacity = 0;
}

template<class T1,class T2>
class Stack
{
public:
	Stack(int capacity = 4) :
		_a(new T1 [capacity]),
		_top(0),
		_capacity(capacity)
	{
		cout << "Stack" << endl;
	}

	~Stack()
	{
		delete[] _a;
		_top = 0;
		_capacity = 0;
		cout << "~" << endl;
	}

	void push(T1 X);
private:
	T1* _a;
	int _top;
	int _capacity;

};

template<typename T1, typename T2>
void Stack<T1, T2>::push(T1 x)
{
	_a[_top] = x;
	_top++;
}

//int main()
//{
//	SeqList<int> s1;
//	s1.push(3);
//
//	Stack<int, double> st1(10);
//	st1.push(1);
//	st1.push(1.0);
//	return 0;
//}



int main()
{
	string s1 = "aaa";
	string s2("aaa");
	s1.pop_back();
	s1.push_back('s');
	cout << s1 << endl;
	
}


